package com.oldroid.apps.getit.util;


import com.dropbox.client.DropboxAPI;
import com.dropbox.client.DropboxAPI.Config;
import com.dropbox.client.DropboxAPI.Entry;
import com.dropbox.client.DropboxAPI.FileDownload;
/**
 * 
 * This Class provides a nice encapsulation of the DropBox Entry objects
 * 
 * @author Jervis
 *
 */
public class DropBoxFile {

	private String name;
	private String dateModified;
	private String path; 
	private long size; 
	private boolean isDir; 
	private Entry entry; 
	private String parentPath; 
	
	public DropBoxFile(Entry e){
		
		this.entry = e; 
		
		this.size = e.bytes; 
		this.isDir = e.is_dir;
		this.dateModified =  e.modified;
		this.path = e.path;
		this.parentPath = e.parentPath(); 
		this.name = e.fileName(); 
				 
	}
	
	
	/**
	 * Returns the parent path of this file
	 * @return the parent path of this file
	 */
	public String getParentPath(){
		
		return parentPath; 
	}
	/**
	 * Returns the file name
	 * @return the file name
	 */
	public String getFileName(){
		return name; 
	}
	
	/**
	 * Gets the last date modified
	 * @return last date modified
	 */
	public String getDateModified(){
		return dateModified; 
	}
	
	/**
	 * Gets the full path of this file
	 * @return the full path of this file
	 */
	public String getPath(){
		return path; 
	}
	
	
	/**
	 * Gets the size of this file
	 * @return the size of this file
	 */
	public long getSize() {
		return size; 
	}
	
	/**
	 * Returns the underlying dropbox entry file object tha's being encapsulated
	 * @return the underlying dropbox entry object
	 */
	public Entry getDropBoxEntryObject(){
		
		return entry; 
	}
	
	
	
	/**
	 * Returns true if this file is a directory
	 * @return true if this file is a directory
	 */
	public boolean isDir(){
		return isDir; 
	}
	
	
	/**
	 * Returns true if this file is NOT a directory
	 * @return true if this file is NOT a directory
	 */
	public boolean isAFile(){
		return !isDir; 
	}
}
